//
//  DB_NetFollowReading.h
//  KidReading
//
//  Created by YangShuai on 16/9/30.
//  Copyright © 2016年 刘赞黄Telen. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FollowReadingTableViewCell.h"
@interface DB_NetFollowReading : NSObject

+ (DB_NetFollowReading*)shareSingle;

#pragma mark - Local

//通过相对路径获取本地全路径
-(NSString*)getFullPathWithRelativePath:(NSString*)relativePath;

//判断是否包含该句录音
- (void)isContainWordRecordWithBookId:(NSInteger)bookId PageIndex:(NSInteger)pageIndex SenIndex:(NSInteger)senIndex IsExist:(void(^)(NSString* localFullPath, NSString* relativePath,BOOL isLocalExist,BOOL isSeverExist))isExist;
//下载某一句的录音
-(void)downloadRecordWithRelativePath:(NSString*)relativePath LocalFullPath:(NSString*)localFullPath completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
//干掉当前页的录音
- (void)removeCurrentLocalRecordWithBookId:(NSInteger)bookId PageIndex:(NSInteger)pageIndex SenIndex:(NSInteger)senIndex;

//成功存储数据库
-(void)updateASRResultToDBWithDict:(NSDictionary*)resultDict Complete:(void (^)(void))complete;
//上传同步失败存储数据库
-(void)updateUploadFailedASRResultToDBWithDict:(NSDictionary*)resultDict;

#pragma mark - Net
//将录音文件上传至upYUn
-(void)uploadFollowReadingRecordFileWithSaveKey:(NSString*)saveKey EvalResultDict:(NSDictionary*)evalResultDict Success:(void (^)(NSURLResponse *response, id responseData))success Failure:(void (^)(NSError *error))failure Progress:(void (^)(CGFloat percent, int64_t requestDidSendBytes))progress;
//同步失败数据
-(void)reUpdateRecordAndASRResultWithBookId:(NSInteger)bookId;

//更新当前正在运行的Cell以及为哪个button
-(void)updateRuningCellWithBookId:(NSInteger)bookId PageIndex:(NSInteger)pageIndex SentenceId:(NSInteger)sentenceId RuningBtn:(StatusButton*)runingBtn CurrentTime:(NSTimeInterval)currentTime;
//无Cell正在Runing
-(void)cleanRuningCellInfo;
//记录当前正在播放的Cell以及当前的按钮进度
-(void)checkCellIsRuningWithBookId:(NSInteger)bookId PageIndex:(NSInteger)pageIndex SentenceId:(NSInteger)sentenceId Complete:(void(^)(BOOL isRuning, StatusButton* runingButton, NSTimeInterval currentTime))complete;

@end
